package memorphic.slide
{
	import mx.states.State;
	import mx.utils.UIDUtil;


	[Event(name="exitToAnyState", type="memorphic.slide.StateEvent")]
	[Event(name="exitToParentState", type="memorphic.slide.StateEvent")]
	[Event(name="exitToUnrelatedState", type="memorphic.slide.StateEvent")]
	[Event(name="enterFromAnyState", type="memorphic.slide.StateEvent")]
	[Event(name="enterFromChildState", type="memorphic.slide.StateEvent")]
	[Event(name="enterFromParentState", type="memorphic.slide.StateEvent")]
	[Event(name="enterFromUnrelatedState", type="memorphic.slide.StateEvent")]
	
	/**
	 * Extends <code>mx.states.State</code> to add a <code>uri</code> property. Use this in MXML views 
	 * instead of <code>&ltmx:State&gt;</code> in order for Slide's view management to work.
	 * 
	 * Note: you must specify the <code>uri</code> but the <code>name</code> property will be generated
	 * if none is given.
	 */
	public class ViewState extends State
	{
		
		private static var generatedStateNameCount:uint = 0;
		
		public var uri:String;
		
		public function ViewState()
		{
			// this makes the name attribute optional
			name = "__slide_state_" + (generatedStateNameCount++);
		}
	}
}